Skip to content

Better serverinfo command#11

Open
RoeeLupo wants to merge 2 commits intoThe-SourceCode:masterfrom
RoeeLupo:master
Open

Better serverinfo command#11
RoeeLupo wants to merge 2 commits intoThe-SourceCode:masterfrom
RoeeLupo:master

Conversation

@RoeeLupo
Copy link
Copy Markdown

No description provided.

@ersu98
Copy link
Copy Markdown

ersu98 commented Aug 30, 2018

Remember that "IconURL" shouldnt be used as a function, this gives back an error.

You need to change these two code lines:

.setAuthor(message.guild.name, message.guild.iconURL())
.setThumbnail(message.guild.iconURL())

Change it into this or it simply wont work since iconURL isnt a valid function.

.setAuthor(message.guild.name, message.guild.iconURL)
.setThumbnail(message.guild.iconURL)

@RoeeLupo
Copy link
Copy Markdown
Author

Sorry, this code was originally made for Discord.js version 12.0.0-dev, in this version it needs to be iconURL() and avatarURL()

@RoeeLupo
Copy link
Copy Markdown
Author

I've fixed it

Copy link
Copy Markdown

@ipadpuppydogdude1 ipadpuppydogdude1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks fine to me

Copy link
Copy Markdown

@Jaylxnn Jaylxnn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good Job of improving

Comment on lines +1 to +11
const Discord = require("discord.js");

module.exports.run = async (bot, message, args) => {
function checkDays(date) {
let now = new Date();
let diff = now.getTime() - date.getTime();
let days = Math.floor(diff / 86400000);
return days + (days == 1 ? " day" : " days") + " ago";
};
let verifLevels = ["None", "Low", "Medium", "(╯°□°)╯︵ ┻━┻", "┻━┻ミヽ(ಠ益ಠ)ノ彡┻━┻"];
let region = {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cood

"russia": ":flag_ru: Russia",
"southafrica": ":flag_za: South Africa"
};
const embed = new Discord.RichEmbed()
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const embed = new Discord.MessageEmbed() // Discord V12

.addField("ID", message.guild.id, true)
.addField("Owner", `${message.guild.owner.user.username}#${message.guild.owner.user.discriminator}`, true)
.addField("Region", region[message.guild.region], true)
.addField("Total | Humans | Bots", `${message.guild.members.size} | ${message.guild.members.filter(member => !member.user.bot).size} | ${message.guild.members.filter(member => member.user.bot).size}`, true)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.addField("Total | Humans | Bots", `${message.guild.members.size} | ${message.guild.members.filter(member => !member.user.bot).size} | ${message.guild.members.filter(member => member.user.bot).size}`, true)
.addField("Total | Humans | Bots", `${message.guild.members.cache.size} | ${message.guild.members.cache.filter(member => !member.user.bot).size} | ${message.guild.members.cache.filter(member => member.user.bot).size}`, true)

For Discord.js V12

.addField("Owner", `${message.guild.owner.user.username}#${message.guild.owner.user.discriminator}`, true)
.addField("Region", region[message.guild.region], true)
.addField("Total | Humans | Bots", `${message.guild.members.size} | ${message.guild.members.filter(member => !member.user.bot).size} | ${message.guild.members.filter(member => member.user.bot).size}`, true)
.addField("Verification Level", verifLevels[message.guild.verificationLevel], true)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.addField("Verification Level", verifLevels[message.guild.verificationLevel], true)
.addField("Verification Level", message.guild.verificationLevel, true)

For Discord.js V12

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

گوزززز

.addField("Region", region[message.guild.region], true)
.addField("Total | Humans | Bots", `${message.guild.members.size} | ${message.guild.members.filter(member => !member.user.bot).size} | ${message.guild.members.filter(member => member.user.bot).size}`, true)
.addField("Verification Level", verifLevels[message.guild.verificationLevel], true)
.addField("Channels", message.guild.channels.size, true)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.addField("Channels", message.guild.channels.size, true)
.addField("Channels", message.guild.channels.cache.size, true)

For Discord.js V12

.addField("Total | Humans | Bots", `${message.guild.members.size} | ${message.guild.members.filter(member => !member.user.bot).size} | ${message.guild.members.filter(member => member.user.bot).size}`, true)
.addField("Verification Level", verifLevels[message.guild.verificationLevel], true)
.addField("Channels", message.guild.channels.size, true)
.addField("Roles", message.guild.roles.size, true)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.addField("Roles", message.guild.roles.size, true)
.addField("Roles", message.guild.roles.cache.size, true)

For Discord.js V12

.addField("Channels", message.guild.channels.size, true)
.addField("Roles", message.guild.roles.size, true)
.addField("Creation Date", `${message.channel.guild.createdAt.toUTCString().substr(0, 16)} (${checkDays(message.channel.guild.createdAt)})`, true)
.setThumbnail(message.guild.iconURL)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.setThumbnail(message.guild.iconURL)
.setThumbnail(message.guild.iconURL())

For Discord.js V12

Copy link
Copy Markdown

@Kyro3400 Kyro3400 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may not be staff, but it looks good

.addField("Name", message.guild.name, true)
.addField("ID", message.guild.id, true)
.addField("Owner", `${message.guild.owner.user.username}#${message.guild.owner.user.discriminator}`, true)
.addField("Region", region[message.guild.region], true)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.addField('Server region', message.guild.region, true)

Repository owner deleted a comment from timmy0909 Apr 9, 2021
Repository owner deleted a comment from ClankoreTheGreat Apr 9, 2021
Copy link
Copy Markdown

@azawat7 azawat7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

let days = Math.floor(diff / 86400000);
return days + (days == 1 ? " day" : " days") + " ago";
};
let verifLevels = ["None", "Low", "Medium", "(╯°□°)╯︵ ┻━┻", "┻━┻ミヽ(ಠ益ಠ)ノ彡┻━┻"];
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Epic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.